package com.qianfeng.openapi.web.master.mapper;


import com.qianfeng.openapi.web.master.dto.TableParam;
import com.qianfeng.openapi.web.master.entity.SysMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/11/25
 * @Time: 下午5:09
 */
public interface SysMenuMapper {

    /**
     * 查询目录
     * @param uid
     * @return
     */
    public List<SysMenu> findDirMenuByUserId(long uid);

    /**
     * 查询某个目录菜单
     * @param uid
     * @return
     */
    public List<SysMenu> findMenuByUserId(@Param("uid") long uid, @Param("parentId") long parentMenuId);

    /**
     * 查权限
     * @param uid
     * @return
     */
    public List<String> findPermsuByUserId(long uid);

    /**
     * 分页
     * @param param
     * @return
     */
    public List<SysMenu> findMenuByPage(TableParam param);
    public int findTotalMenu(TableParam param);


    //树形结构
    public List<SysMenu> findMenuTree();

    /**
     * 新增菜单
     * @param sysMenu
     * @return
     */
    public  int  save(SysMenu sysMenu);

    /**
     *
     * 管理员插入到角色菜单关系表
     * @return
     */
    public  int  saveRoleMenu(@Param("roleId") int roleId, @Param("menuId") long menuId);


    /**
     * 修改
     * @param menuId
     * @return
     */
    public  SysMenu findMenuById(long menuId);

    public  int  update(SysMenu sysMenu);


    public  int  deleteBatch(List<Integer> ids);
}
